#include <string.h>
#include <stdio.h>

// regualar comments

%%{
    machine foo;
    main :=
        # i means case-insensitive;
        # // means RE
        ('foo' | "bar"i | '' | /gee/ | /GET/i | /[0-9]/)
        0 @{ 
            // c comments
            /* setting */
            res2 = 2;
        };
}%%

// 写入machine所需的常量静态数据，比如name_start表示的初始状态
%% write data;

int main(int ac, char* av[]) {
    // cs, p, pe must be declared
    int cs, res2 = 0;
    if (ac > 1) {
        char *p = av[1];
        char *pe = p + strlen(p) + 1;

        %% write init;
        %% write exec;
    }
    printf("result = %i\n", res2);
    return 0;
}

